Optimal. Leaf size=62 \[ \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2795, 21, 2852,
212} \begin {gather*} \frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a \sin (e+f x)+a}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 21
Rule 212
Rule 2795
Rule 2852
Rubi steps
\begin {align*} \int \frac {\cot ^2(e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}+\frac {\int \frac {\csc (e+f x) \left (-\frac {a}{2}-\frac {1}{2} a \sin (e+f x)\right )}{\sqrt {a+a \sin (e+f x)}} \, dx}{a}\\ &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}-\frac {\int \csc (e+f x) \sqrt {a+a \sin (e+f x)} \, dx}{2 a}\\ &=-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}+\frac {\text {Subst}\left (\int \frac {1}{a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=\frac {\tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {\cot (e+f x)}{f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(138\) vs. \(2(62)=124\).
time = 0.23, size = 138, normalized size = 2.23 \begin {gather*} \frac {\csc \left (\frac {1}{4} (e+f x)\right ) \sec \left (\frac {1}{4} (e+f x)\right ) \left (-2 \cos \left (\frac {1}{2} (e+f x)\right )+2 \sin \left (\frac {1}{2} (e+f x)\right )+\left (\log \left (1+\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (1-\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right ) \sin (e+f x)\right ) \left (1+\tan \left (\frac {1}{2} (e+f x)\right )\right )}{8 f \sqrt {a (1+\sin (e+f x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.48, size = 103, normalized size = 1.66
method | result | size |
default | \(-\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-\arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}}{\sqrt {a}}\right ) a \sin \left (f x +e \right )+\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {a}\right )}{a^{\frac {3}{2}} \sin \left (f x +e \right ) \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(103\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 288 vs.
\(2 (58) = 116\).
time = 0.38, size = 288, normalized size = 4.65 \begin {gather*} \frac {{\left (\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 1\right )} \sin \left (f x + e\right ) - 1\right )} \sqrt {a} \log \left (\frac {a \cos \left (f x + e\right )^{3} - 7 \, a \cos \left (f x + e\right )^{2} + 4 \, {\left (\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 3\right )} \sin \left (f x + e\right ) - 2 \, \cos \left (f x + e\right ) - 3\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {a} - 9 \, a \cos \left (f x + e\right ) + {\left (a \cos \left (f x + e\right )^{2} + 8 \, a \cos \left (f x + e\right ) - a\right )} \sin \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right )^{2} - 1\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 1}\right ) + 4 \, \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{4 \, {\left (a f \cos \left (f x + e\right )^{2} - a f - {\left (a f \cos \left (f x + e\right ) + a f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (e + f x \right )}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 138 vs.
\(2 (58) = 116\).
time = 10.74, size = 138, normalized size = 2.23 \begin {gather*} \frac {\sqrt {2} \sqrt {a} {\left (\frac {\sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) \right |}}\right )}{a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {4 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (2 \, \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {{\mathrm {cot}\left (e+f\,x\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________